<template>
    <div class="dialog-container">
        <div class="dialog-box">
            <div class="title" v-html="dialogConent.title"></div>
            <div class="dialog-btns">
                <div :class="{'left-btns': true, 'btns': true, 'select': cur==0}" @click="change(0)">{{dialogConent.left}}</div>
                <div :class="{'right-btns': true, 'btns': true, 'select': cur==1}" @click="change(1)">{{dialogConent.right}}</div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    props: ['dialogConent'],
    data () {
        return {
            cur: 1 
        }
    },
    methods: {
        change (index) {
            this.cur = index
            if (index == 0) {
                this.$emit('leftBtn', true)
            } else {
                this.$emit('rightBtn', true)
            }
        }
    }
}
</script>
<style lang="less" scoped>
    .dialog-container {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        .dialog-box {
            font-size: 0;
            width: 5.6rem;
            height: 3.1rem;
            background: #fff;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -2.8rem;
            margin-top: -1.5rem;
            border-radius: 4px;
            text-align: center;
            box-sizing: border-box;
            .title {
                height: 2.3rem;
                box-sizing: border-box;
                text-align: center;
                font-size: 0.32rem;
                display: flex;
                color: #282828;
                border-bottom: 1px solid #ccc;
                justify-content: center;
                align-items: center;
            }
            .dialog-btns {
                padding: 0.2rem 0;
                display: flex;
                .btns {
                    flex: 1;
                    text-align: center;
                    color: #707070;
                    font-size: 0.32rem;
                    border-right: 1px solid #ccc;
                    &:last-child {
                        border-right: none;
                    }
                }
                .select {
                    color: #29abae;
                }
            }
        }
    }
</style>
